﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>培训列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <link href="https://cdn.bootcss.com/amazeui/2.7.2/css/amazeui.css" rel="stylesheet">
    <link href="css/common.css" rel="stylesheet" />
    <style>
        body {
            background: #f6f6f6;
        }

        .veads1_i1 {
            display: block;
            float: left;
            margin-top: 2%;
            width: 2.5%;
        }

        .veads1_s1 {
            display: block;
            text-align: center;
            font-size: 1.8rem;
        }

        .head {
            margin-bottom: 2%;
            width: 100%;
            overflow: hidden;
        }

        .main {
            width: 100%;
        }

        .game_maind1 {
            padding: 2% 4%;
            background: #fff;
            display: flex;
            justify-content: space-between;
        }

        .game_mainsp1 {
            text-align: center;
            color: #fff;
            background: #019dfe;
            padding: 1% 0;
            width: 40%;
            display: block;
            transform: rotate(-45deg);
            position: absolute;
            top: 5%;
            left: -13%;
        }

        .game_main {
            position: relative;
            overflow: hidden;
            max-height: 15rem;
            height: 15rem;
        }

        a {
            color: #000;
        }
    </style>
</head>
<body>
    <div class="page" id="page" v-cloak>
        <div class="head">

            <header data-am-widget="header" class="am-header am-header-default" style="background-color: #FFFFFF; border-bottom: 1px solid rgb(211, 211, 211);">
                <div class="am-header-left am-header-nav" onclick="goBack()">
                    <a href="javascript:" class="">
                        <img class="am-header-icon-custom" src="images/veas07.png" alt="" />
                    </a>
                </div>
                <h4 class="am-header-title" style=" color: black;">培训列表</h4>
                <div class="am-header-right am-header-nav"><a href="/Wap/Index.html" class="am-header-icon am-icon-home" style="color: #A9A9A9; "></a></div>
            </header>
            <div class="am-u-sm-12" style="background: #fff;padding: 2% 0">
                <div class="am-form-group am-form-icon am-form-feedback" style="width: 75%;display: block;margin: 0 auto;">
                    <input type="text" v-model="keyword" class="am-form-field search" placeholder="输入培训名称" style="padding: 3%;border-radius: 50px;padding-left: 7% !important;background: #f2f2f2">
                    <span class="am-icon-search" style="right: 1.5rem;"></span>
                </div>
            </div>
        </div>
        <div class="main" v-on:click="ActivityInfo(activity.o.gId)" v-for="activity in activitylist">
            <a href="javascript:">
                <div class="game_main">
                    <img v-bind:src="activity.Img" alt="" style="width: 100%;display: block;">
                    <span class="game_mainsp1">{{activity.state}}</span>
                    <span style="font-size:1.6rem;display: block;width:100%;background: rgba(0,0,0,0.4);color: #fff;bottom: 0;position: absolute;padding-left: 3%">报名时间：{{activity.startSignTime}}至{{activity.endSignTime}}</span>
                </div>
            </a>
            <div class="game_maind1">
                <div><img src="images/personticket01.png" alt="" style="width: 15%;float: left;display: block; margin-top: 10%;margin-right: 1%"><span style="color: #606060;font-size: 1.4rem">{{activity.Adress}}</span></div>
                <div><img src="images/vipcard03.png" alt="" style="width: 11%;margin-right: 4%;"><span style="color: #606060;font-size: 1.4rem">{{activity.endTime}}</span></div>
            </div>
        </div>
    </div>
</body>
<script src="https://use.fontawesome.com/ca6b609d64.js"></script>
<script src="https://cdn.bootcss.com/jquery/1.8.3/jquery.js"></script>
<script src="js/common.js"></script>
<script src="https://cdn.bootcss.com/vue/2.5.9/vue.js"></script>
<script src="https://cdn.bootcss.com/amazeui/2.7.2/js/amazeui.js"></script>
</html>

<script>
    var page = new Vue({
        el: '#page',
        data: {
            activitylist: [],
            page: 1,
            pagesize: 10,
            keyword: '',
            pageinfo: {},
        },
        methods: {
            getactivitylist: function () {
                var that = this;

                $.ajax({
                    type: 'Get',
                    data: { page: that.page, pagesize: that.pagesize, type: 3, keyword: that.keyword },
                    url: window.apiUrl + '/Api/Field/GetTrainList',
                    success: function (data) {
                        console.log(data);
                        console.log(data.data.activityList);
                        if (data.errcode == 0) {
                            if (that.page == 1) {
                                that.activitylist = data.data.activityList;
                            } else {
                                $(data.data.activityList).each(function () {
                                    that.activitylist.push(this);
                                })
                            }
                            that.pageinfo = data.data.Page;
                        } else {
                            alert(data.errmsg);
                        }
                    },
                    //error: function () {
                    //    alert("服务器加载异常");
                    //}
                })
            },
            ActivityInfo: function (gId) {
                location.href = 'TrainInfo.html?gId=' + gId;
            }
        },
        watch: {
            keyword: function () {
                this.page = 1;
                this.getactivitylist();
            },
            page: function () {
                this.getactivitylist();
            }
        }
    })
    $(function () {
        page.getactivitylist();
    })
</script>
